package org.jet.emall.rbac.transfer;

import org.jet.emall.rbac.dto.AdminUserViewDTO;
import org.jet.emall.rbac.dto.NewAdminUserDTO;
import org.jet.emall.rbac.dto.UpdateAdminUserDTO;
import org.jet.emall.rbac.model.NewAdminUserModel;
import org.jet.emall.rbac.model.UpdateAdminUserModel;
import org.jet.emall.rbac.vo.AdminUserViewVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author xiaozai
 * @version 1.0
 * @date 2020-04-05 11:16
 */
@Mapper
public interface AdminUserVoTransfer {
    AdminUserVoTransfer INSTANCE = Mappers.getMapper(AdminUserVoTransfer.class);

    /**
     * 将DTO转VO
     * @param dto
     * @return
     */
    AdminUserViewVO toVo(AdminUserViewDTO dto);

    /**
     * 将DTO集合转VO集合
     * @param dtoList
     * @return
     */
    List<AdminUserViewVO> toVoList(List<AdminUserViewDTO> dtoList);

    /**
     *  新键用户的MODEL转DTO
     * @param newUser
     * @return
     */
    NewAdminUserDTO toDto(NewAdminUserModel newUser);

    /**
     * 更新用户的MODEL转DTO
     * @param updateUser
     * @return
     */
    UpdateAdminUserDTO toDto(UpdateAdminUserModel updateUser);
}
